﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using BrokerBase.Lib.Policy;

namespace broker.duty.SM
{
    class Class20
    {
        public void Calc1(IPolicyPeriodActing ppa, IDutyActing da)
        {
            if (ppa.SchemePeriodActing.InsurantStates.Contains("身故"))
            {

                da.Value = ppa.Amount;
                ppa.IsCurrentFinish = true;

            }
        }

        public void Calc1(IPolicyPeriodActing ppa, IDutyActing da)
        {
            if (ppa.SchemePeriodActing.InsurantStates.Contains("全残"))
            {

                da.Value = ppa.Amount;
                ppa.IsCurrentFinish = true;

            }
        }

        public void Calc1(IPolicyPeriodActing ppa, IDutyActing da)
        {
            if (ppa.Period == ppa.PolicyActing.PeriodActings.Count() - 1)
            {
                da.Value = ppa.PolicyActing.Policy.Amount;
                ppa.IsCurrentFinish = true;
            }
        }


        public void Calc1(IPolicyPeriodActing ppa, IDutyActing da)
        {
            ppa.Amount = ppa.PolicyActing.Policy.Amount * (1 + (0.1 * ppa.Period));
        }

        public void Calc1(IPolicyPeriodActing ppa, IDutyActing da)
        {
            if (ppa.Period > 0)
            {
                double f = (double)ppa.SchemePeriodActing.SchemeActing.GetAuxConfigValue("分红率(预估)");

                da.Value = ppa.TotalFee * f;
            }
        }
    }
}
